import 'package:Smart/utils/routers/page_jump_service.dart';
import 'package:flutter/material.dart';
//屏幕适配
import 'package:Smart/utils/screen_unit/gs_screen_util.dart';
import '../res/colors_res.dart';
import 'package:flutter/cupertino.dart';
//拨打电话
import 'package:url_launcher/url_launcher.dart';
//异步
import 'package:async/async.dart';
import 'gs_bluetooth_dialog.dart';
import 'gs_callout_page.dart';

class SpringFourPage extends StatelessWidget {
  const SpringFourPage({Key key}) : super(key: key);
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('spring4'),
      ),
      body: Center(
        child: Column(
          children: <Widget>[
            //弹出蓝牙对话框---一个按钮
            RaisedButton(
              color: ColorsRes.color_ffffff,
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (BuildContext context) {
                      return GSOnlyBlueToothDialog();
                    });
              },
              child: Text(
                "使用蓝牙钥匙对话框1",
                style: TextStyle(fontSize: 16.w),
              ),
            ),

            //弹出蓝牙对话框---两个按钮---确认开启 取消
            RaisedButton(
              color: ColorsRes.color_ffffff,
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (BuildContext context) => GSBlueToothDialog(
                        context,
                        '激活蓝牙钥匙请满足以下条件:                1、网络连接正常；                   2、整车已通电；                      3、手机蓝牙功能已打开；                  4、手机靠近车辆；',
                        '取消',
                        '确认开启'));
              },
              // onPressed: GSBlueToothDialog,
              child: Text(
                "使用蓝牙钥匙对话框2",
                style: TextStyle(fontSize: 16.w),
              ),
            ),

            //弹出蓝牙对话框---两个按钮---继续激活  放弃激活
            RaisedButton(
              color: ColorsRes.color_ffffff,
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (BuildContext context) => GSBlueToothDialog(
                        context,
                        '该账号曾在其他手机登录，若开 启当前设备的蓝牙钥匙功能，则 其他登录过该账号的设备的蓝牙 钥匙将会失效。',
                        '放弃激活',
                        '继续激活'));
              },
              // onPressed: GSBlueToothDialog,
              child: Text(
                "使用蓝牙钥匙对话框3",
                style: TextStyle(fontSize: 16.w),
              ),
            ),

            //一键呼叫
            RaisedButton(
              color: ColorsRes.color_ffffff,
              onPressed: () {
                showDialog(
                    context: context,
                    builder: (BuildContext context) => GSCallOut());
              },
              child: Text(
                "一键呼出",
                style: TextStyle(fontSize: 16.w),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
